package com.bocai.grainshop.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.bocai.common.valid.AddVaild;
import com.bocai.common.valid.ListValue;
import com.bocai.common.valid.UpdateStuats;
import com.bocai.common.valid.UpdateVaild;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 品牌
 * 
 * @author SunJinBo
 * @email 2374461077@qq.com
 * @date 2022-03-01 17:02:35
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id
	 */
	@NotNull(message = "修改不可以为null",groups = {UpdateVaild.class})
	@Null(message = "新增可以为null",groups = {AddVaild.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名 @NotBlank校验注解 不能为空
	 */
	@NotBlank(message = "品牌名必须提交",groups = {UpdateVaild.class, AddVaild.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotEmpty(groups = {AddVaild.class})
	@URL(message = "logo必须是一个合法的url地址",groups = {UpdateVaild.class,AddVaild.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]  @ListValue自定义校验注解
	 */
	@ListValue(vals = {0,1},groups = {UpdateStuats.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	@NotEmpty
	@Pattern(regexp = "^[a-zA-Z]$",message = "必须是一个字母",groups = {UpdateVaild.class,AddVaild.class})
	private String firstLetter;
	/**
	 * 排序
	 */
	private Integer sort;

}
